package com.wm.javamall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wm.common.utils.PageUtils;
import com.wm.javamall.order.entity.OrderEntity;
import com.wm.javamall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author weiming
 * @email sshdg140135@foxmail.com
 * @date 2020-12-20 17:38:15
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    OrderEntity getOrderByOrderSn(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);


    PageUtils queryPageWithItem2(Integer pageNum);

    void closeOrder(OrderEntity entity);

    /**
     * 获取当前订单的支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    String handlePayResult(PayAsyncVo vo);

    String handlePayResult(String orderSn);

    /**
     * 取消订单
     */
    void cancelOrder(String orderSn);

    /**
     * 确认收货
     * @param orderSn
     */
    void confirmReceipt(String orderSn);

    /**
     * 获取订单详情页信息
     * @param orderSn
     */
    OrderEntity getOrderDetail(String orderSn);

    void  updateOrder(OrderEntity order);
}

